package top.dark.design.patterns.prototype.shallowcopy;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * Author: Darkn
 * description:
 * Create Time: 2021/4/25 9:52
 */
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Data
public class Sheep implements Cloneable{
    private String no;
    private String name;
    private Integer age;

    @Override
    protected Object clone() {
        Sheep sheep = null;
        try {
            sheep = (Sheep) super.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println(e.getMessage());
        }
        return sheep;
    }
}
